import request from '@/utils/axios'

// 知识库分页
export function getKnowledgeBaseList(params: any) {
  return request.post({
    url: '/path/api/articles/page',
    data: params
  })
}

// 获取创建人
export function getCreateUser(params: any) {
  return request.post({
    url: '/path/api/articles/creator'
  })
}

// 知识库添加修改
export function addKnowledgeBase(params: any) {
  if (params.id) {
    return request.post({
      url: '/path/api/articles/update',
      data: params
    })
  } else {
    return request.post({
      url: '/path/api/articles/save',
      data: params
    })
  }
}

// 详情
export function getKnowledgeBaseDetail(params: any) {
  return request.get({
    url: `/path/api/articles/info/${params.id}`
  })
}

// 图片上传
export function uploadImg(params: any) {
  return request.upload({
    url: '/path/api/articles/upload',
    data: params
  })
}
